using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for ValidatingUserControl
/// </summary>
public class DataValidatingUserControl :System.Web.UI.UserControl
{
    private bool isDataValid = false;

    public DataValidatingUserControl()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public void SetDataValid()
    {
        isDataValid = true;
    }

    protected override void Render(HtmlTextWriter writer)
    {
        if (isDataValid)
            base.Render(writer);
        //else this control will not render
    }
}
